#include <iostream>
#include <pthread.h>
#include <vector>
#include <string>
#include <unistd.h>
void* running(void* str){
    const char* s = static_cast<const char*>(str);
    while(true)
    {
        std::cout << s << std::endl;
        sleep(1);
    }
    return nullptr;
}
int main()
{
    std::vector<int> vt;
    for(int i = 0; i < 10; i++)
    {
        pthread_t tid;
        char* buffer = new char[128];
        snprintf(buffer, 128, "thread: %d", i);
        pthread_create(&tid, nullptr, running, buffer);
    }
    sleep(100);
}